<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <link rel="StyleSheet" href="css/style.css" type="text/css">
  <meta content="text/html; charset=ISO-8859-1"
 http-equiv="content-type">
  <meta name="verify-v1"
 content="sRQSq4VA5FRMhwzFB4U3I9AtgLMtIWTdpVVO6jg1az4=">
  <title>AtomServer BLAH</title>
  <script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
  </script>
  <script type="text/javascript">
var pageTracker = _gat._getTracker("UA-4603527-2");
pageTracker._initData();
pageTracker._trackPageview();
  </script>
</head>
<body class="maincontent">
<h1><img style="width: 75px; height: 75px;" src="images/atom-logo.gif"
 alt="logo">&nbsp;
<span style="font-weight: bold;"></span>AtomServer, Upgrading to
AtomServer 2.3<br>
</h1>
<div class="content"><span style="font-style: italic;">
Chris Berry. Updated 09/08/010</span><br>
<br>
This
document describes specific details about upgrading an existing
installation to AtomServer version 2.3.<br>
<hr style="width: 100%; height: 2px;">
<h2><a name="general"></a>General Information<br>
</h2>
AtomServer 2.3 broke the single DataSource (which was indentified by
the Spring bean; <span style="font-family: monospace;">org.atomserver-dataSource</span>)
into
three distinct DataSources. These new DataSources include;<br>
<ul>
  <li>A Read-only DataSource (<span style="font-family: monospace;">org.atomserver-read-dataSource</span>).
Used
for all read operations (GET), <span style="font-style: italic;">except</span>
Aggregate Feeds/Entries.</li>
  <li>A&nbsp;Read-write DataSource (<span
 style="font-family: monospace;">org.atomserver-dataSource</span>).
Used for all write operations (PUT, POST, DELETE)</li>
  <li>An Aggregate DataSource (<span style="font-family: monospace;">org.atomserver-aggregate-dataSource</span>).
Used
for all Aggregate Feeds/Entries reads.</li>
</ul>
This decomposition was done so that we could have finer control over
the JDBC settings. In particular, <br>
<ul>
  <li>Different timeouts at the JDBC layer. This is critical, since a
JDBC timeout signals the DB to stop (as well as the Server), which
means that we actually remove the load from the DB. Note
that&nbsp;pre-2.3 the overall timeout was based on Aggregate Feeds,
which because that query can perform terribly when it is not "near the
tip" of a Feed of a very large dataset, the timeout was set quite
large, and was, thus, relatively useless.&nbsp; The new timeouts
settings might look something like;</li>
  <ul>
    <li>Read-write = a number slightly less than the "latency time" </li>
    <li>Read-only = 120s&nbsp; (or some such. YMMV)</li>
    <li>Aggregate = 1200s (or some such. YMMV)</li>
  </ul>
  <li>Different pool sizes. This will provide throttling, particularly
for Aggregates, and will allow us a certain level of protection from
Aggregates gone wild.</li>
</ul>
This change as backwards compatible as possible. In particular, we left
around the original DAOs and Impls, which now delegate to the
Read/Write DAOs.<br>
<h2>Conversion</h2>
All that has to be done to upgrade an existing application to
AtomServer 2.3 is the following steps.<br>
<br>
1) If you have extended any of the AtomServer Beans (e.g. <span
 style="font-family: monospace;">databaseBeans.xml</span>), you will
need to change the location of the Classes that have moved around.
The&nbsp;<span style="font-family: monospace;">org.atomserver.core.dbstore.dao</span>
package was refactored. And in particular the Class; <span
 style="font-family: monospace;">org.atomserver.core.dbstore.dao.EntriesDAOiBatisImpl</span>
was moved to <span style="font-family: monospace;">org.atomserver.core.dbstore.dao.impl.EntriesDAOiBatisImpl</span>.
<br>
<br>
2) Define the newly required Java properties in your "env files".
&nbsp;You don't actually have to do this. The new properties are
defaulted as folows. Note, <span style="font-family: monospace;">db.poolsize.max</span>
is the pool size of the read-write DataSource. But you will probbaly
want to trim these pool sizes down since there are now 3 separate
pools.
<div style="margin-left: 40px;"><span style="font-family: monospace;">db.read.poolsize.max=${db.poolsize.max}</span><br
 style="font-family: monospace;">
<span style="font-family: monospace;">db.aggregate.poolsize.max=${db.poolsize.max}</span><br>
</div>
<br>
3) If you extend databaseBeans.xml yourself, then you may want to take
advantage of the 3 new DataSources. For example, a <span
 style="font-family: monospace;">databaseBeans.xml</span> might look
like this;<br>
<div id="codebox"><span style="font-family: monospace;"><br>
</span>
<div style="margin-left: 40px;"><span style="font-family: monospace;">&lt;?xml
version="1.0" encoding="UTF-8"?&gt;</span><br>
<span style="font-family: monospace;">&lt;beans
xmlns="http://www.springframework.org/schema/beans"</span><br>
<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"</span><br>
<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
xsi:schemaLocation="</span><br>
<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
http://www.springframework.org/schema/beans</span><br>
<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd"&gt;</span><br>
&nbsp; &nbsp; &nbsp; &nbsp;<span style="font-family: monospace;">&lt;!--
NOTE: the timeouts are set in the JDBC URLs --&gt; </span><br>
<span style="font-family: monospace;"></span><span
 style="font-family: monospace;">&nbsp;&nbsp;&nbsp; &lt;bean
id="com.homeaway-sqlserver-jtds-BASE-dataSource"</span><br>
<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
class="org.apache.commons.dbcp.BasicDataSource"</span><br>
<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
destroy-method="close"</span><br>
<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
lazy-init="true"</span><br>
<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
depends-on="org.atomserver-propertyConfigurer"</span><br>
<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
abstract="true" &gt;</span><br>
<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;property name="driverClassName" value="${db.driver}"/&gt;</span><br>
<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;property name="username" value="${db.username}"/&gt;</span><br>
<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;property name="password" value="${db.password}"/&gt;</span><br>
<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;property name="maxWait" value="${db.pool.maxWait}"/&gt;</span><br>
<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp; &lt;/bean&gt;</span><br>
<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp; &lt;bean id="<span
 style="font-family: monospace;">org.atomserver-dataSource</span>"</span><br>
<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
class="org.apache.commons.dbcp.BasicDataSource"</span><br>
<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
parent="com.homeaway-sqlserver-jtds-BASE-dataSource" &gt;</span><br>
<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;property name="url" value="${db.url}"/&gt;</span><br>
<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;property name="maxActive" value="${db.poolsize.max}"/&gt;</span><br>
<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;property name="initialSize" value="${db.poolsize.init}" /&gt;</span><br>
<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp; &lt;/bean&gt;</span><br>
<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp; &lt;bean id="<span
 style="font-family: monospace;">org.atomserver-read-dataSource</span>"</span><br>
<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
class="org.apache.commons.dbcp.BasicDataSource"</span><br>
<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
parent="com.homeaway-sqlserver-jtds-BASE-dataSource" &gt;</span><br>
<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;property name="url" value="${db.read.url}"/&gt;</span><br>
<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;property name="maxActive" value="${db.read.poolsize.max}"/&gt;</span><br>
<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;property name="initialSize" value="${db.read.poolsize.init}" /&gt;</span><br>
<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp; &lt;/bean&gt;</span><br>
<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp; &lt;bean id="<span
 style="font-family: monospace;">org.atomserver-aggregate-dataSource</span>"</span><br>
<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
class="org.apache.commons.dbcp.BasicDataSource"</span><br>
<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
parent="com.homeaway-sqlserver-jtds-BASE-dataSource" &gt;</span><br>
<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;property name="url" value="${db.url}"/&gt;</span><br>
<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;property name="maxActive" value="${db.aggregate.poolsize.max}"/&gt;</span><br>
<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;property name="initialSize" value="${db.aggregate.poolsize.init}"
/&gt;</span><br>
<span style="font-family: monospace;">&nbsp;&nbsp;&nbsp; &lt;/bean&gt;</span><br>
<span style="font-family: monospace;">&lt;/beans&gt;</span><br>
<span style="font-family: monospace;"></span></div>
<span style="font-family: monospace;">&nbsp;<br>
</span> </div>
<br>
<br>
</div>
</body>
</html>
